文章目录
  1. 1. Mac OS X中MacPorts安装和使用
  2. 2. Mac OS X中MacPorts安装和使用
    1. 2.0.1. Note

Mac OS X中MacPorts安装和使用

macOS macPort

Mac OS X中MacPorts安装和使用

发表于 2012-10-18 由 owen

转自:http://www.ccvita.com/434.html
//官方文档
http://guide.macports.org/#development.practices.install-docs

Mac下面除了用dmg、pkg来安装软件外,比较方便的还有用MacPorts来帮助你安装其他应用程序,跟BSD中的ports道理一样。MacPorts就像apt-get、yum一样,可以快速安装些软件。

下面将MacPorts的安装和使用方法记录在这里以备查。

访问官方网站http://www.[macports.org/install.php,这里提供有dmg安装和源码安装两种方式,dmg就多说了,下载MacPorts-1.9.2-10.6-SnowLeopard.dmg,下一步下一步安装即可。](http://macports.org/install.php%EF%BC%8C%E8%BF%99%E9%87%8C%E6%8F%90%E4%BE%9B%E6%9C%89dmg%E5%AE%89%E8%A3%85%E5%92%8C%E6%BA%90%E7%A0%81%E5%AE%89%E8%A3%85%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F%EF%BC%8Cdmg%E5%B0%B1%E5%A4%9A%E8%AF%B4%E4%BA%86%EF%BC%8C%E4%B8%8B%E8%BD%BDMacPorts-1.9.2-10.6-SnowLeopard.dmg%EF%BC%8C%E4%B8%8B%E4%B8%80%E6%AD%A5%E4%B8%8B%E4%B8%80%E6%AD%A5%E5%AE%89%E8%A3%85%E5%8D%B3%E5%8F%AF%E3%80%82)

通过Source安装MacPorts

wget http://distfiles.macports.org/MacPorts/MacPorts-1.9.2.tar.gz
tar zxvf MacPorts-1.9.2.tar.gz
cd MacPorts-1.9.2
./configure && make && sudo make install
cd ../
rm -rf MacPorts-1.9.2*

然后将/opt/local/bin和/opt/local/sbin添加到$PATH搜索路径中

编辑/etc/profile文件中,加上

export PATH=/opt/local/bin:$PATH

export PATH=/opt/local/sbin:$PATH
如果无法修改/etc/profile文件,则执行sudo chmod 777 /etc/profile
然后再添加保存

MacPorts使用

更新ports tree和MacPorts版本,强烈推荐第一次运行的时候使用-v参数,显示详细的更新过程。

sudo port -v selfupdate

搜索索引中的软件

port search name

安装新软件

sudo port install name

卸载软件

sudo port uninstall name

查看有更新的软件以及版本

port outdated

升级可以更新的软件

sudo port upgrade outdated

Eclipse的插件需要subclipse需要JavaHL,下面通过MacPorts来安装

sudo port install subversion-javahlbindings
//安装svn 1.7.7
sudo port install subversion 1.7.7

The upgrade action upgrades installed ports and their dependencies when a Portfile in the repository has been updated after a port was installed.

%% sudo port upgrade gnome

If you wish not to upgrade a port’s dependencies, use the -n switch. Note that this will often cause problems.

%% sudo port -n upgrade gnome

If you’d like to upgrade all outdated ports, use this command.

%% sudo port upgrade outdated

Note

The upgrade action by default does not uninstall an upgraded port —it deactivates it. See section Port Images, and also Destroot and Activate phases in Port Phases. If you wish to uninstall the old version, use the -u option.

%% sudo port -u upgrade vile

文章目录
  1. 1. Mac OS X中MacPorts安装和使用
  2. 2. Mac OS X中MacPorts安装和使用
    1. 2.0.1. Note